package jzoffer;

/**
 * @author MaoLin Wang
 * @date 2020/10/7 8:52 上午
 */
public class _14整数切分 {
    public int cuttingRope(int n){
        if (n<4){
            return n-1;
        }
        if (n==4){
            return 4;
        }
        long res=1;
        while (n>4){
            res*=3;
            res%=1000000007;
            n-=3;
        }
        return (int) (res*n%1000000007);

    }
    public static void main(String[] args) {
        int i = new _14整数切分().cuttingRope(10);
        System.out.println(i);
    }
}
